package string;

public class Test {

    public static void main(String[] args) {
        String s1 = "www.tedu.cn";
        String s2 = "http://www.tarena.com.cn";
        String n1 = getHostName(s1);
        String n2 = getHostName(s2);
        System.out.println(n1);
        System.out.println(n2);
    }

    public static String getHostName(String line){
        int start = line.indexOf(".")+1;
        int end = line.indexOf(".",start);
        String name = line.substring(start,end);
        return name;
    }


}
